use axum::{
    routing::{get, post},
    Router, extract::DefaultBodyLimit
};
use com::mdb::gridfs::gridfs_route;

mod master;

pub fn auth_routes() -> Router{
    Router::new()
    .route("/upload",      post(master::upload))
    .route("/uploads",      post(master::uploads))
    .route("/mg_upload",      post(master::mg_upload))
    .route("/mg_uploads",      post(master::mg_uploads))
	// 5M
	.layer(DefaultBodyLimit::max(1048576 * 5))  
	
    .route("/mg_upload_look",      get(gridfs_route::look_upload_by_url))
    .route("/mg_upload_looks",      get(gridfs_route::look_upload_by_urls))
    //
    .route("/mg_download",      get(gridfs_route::mg_download))
    //
    .route("/mg_look",      get(gridfs_route::look_by_url))
    .route("/mg_looks",      get(gridfs_route::look_by_urls))
    // .route("/mg_look_by_id_bucket_type",    get(gridfs_route::look_by_id_bucket_type))
}